﻿using System;
using System.Collections.Generic;
using System.Text;

using H2.NET.Data.Common;
using H2.NET.Data.Common.Mappings;
using H2.NET.Data.Common.Validates;

namespace H2.NET.Business
{
    [Table]
    [Serializable]
    public partial class mdc_Bom_Sefi_2 : DataObject
    {
        [ID]
        [DID]
        public string ID { get { return _ID; } set { _ID = value; EntityState.FieldChange("ID"); } }
        private string _ID;
        public static FieldInfo id = new FieldInfo("mdc_Bom_Sefi_2", "ID");

        [Column]
        public string Process { get { return _Process; } set { _Process = value; EntityState.FieldChange("Process"); } }
        private string _Process;
        public static FieldInfo process = new FieldInfo("mdc_Bom_Sefi_2", "Process");

        [Column]
        public int Incident { get { return _Incident; } set { _Incident = value; EntityState.FieldChange("Incident"); } }
        private int _Incident;
        public static FieldInfo incident = new FieldInfo("mdc_Bom_Sefi_2", "Incident");

        [Column]
        public string UserName { get { return _UserName; } set { _UserName = value; EntityState.FieldChange("UserName"); } }
        private string _UserName;
        public static FieldInfo userName = new FieldInfo("mdc_Bom_Sefi_2", "UserName");

        [Column]
        public int No { get { return _No; } set { _No = value; EntityState.FieldChange("No"); } }
        private int _No;
        public static FieldInfo no = new FieldInfo("mdc_Bom_Sefi_2", "No");

        [Column]
        public string Ict { get { return _Ict; } set { _Ict = value; EntityState.FieldChange("Ict"); } }
        private string _Ict;
        public static FieldInfo ict = new FieldInfo("mdc_Bom_Sefi_2", "Ict");

        [Column]
        public string Component_Text { get { return _Component_Text; } set { _Component_Text = value; EntityState.FieldChange("Component_Text"); } }
        private string _Component_Text;
        public static FieldInfo component_text = new FieldInfo("mdc_Bom_Sefi_2", "Component_Text");

        [Column]
        public string Component_Description { get { return _Component_Description; } set { _Component_Description = value; EntityState.FieldChange("Component_Description"); } }
        private string _Component_Description;
        public static FieldInfo component_description = new FieldInfo("mdc_Bom_Sefi_2", "Component_Description");

        [Column]
        public string Quantity
        {
            get
            {
                if (string.IsNullOrEmpty(Ict))
                {
                    _Quantity = "";
                }
                else
                {
                    if (Ict.Substring(0, 1).ToUpper() == "T")
                    {
                        _Quantity = "1";
                    }
                }
                return _Quantity;
            }
            set { _Quantity = value; EntityState.FieldChange("Quantity"); }
        }
        private string _Quantity;
        public static FieldInfo quantity = new FieldInfo("mdc_Bom_Sefi_2.", "Quantity");


        [Column]
        public string Un
        {
            get
            {
                if (string.IsNullOrEmpty(Ict))
                {
                    _Un = "";
                }
                else
                {
                    if (Ict.Substring(0, 1).ToUpper() == "T")
                    {
                        _Un = "TXT";
                    }
                    else
                    {
                        _Un = "KG";
                    }
                }
                return _Un;

            }
            set { _Un = value; EntityState.FieldChange("Un"); }
        }
        private string _Un;
        public static FieldInfo un = new FieldInfo("mdc_Bom_Sefi_2.", "Un");

        [Column]
        [NowDate]
        public DateTime Time { get { return _Time; } set { _Time = value; EntityState.FieldChange("Time"); } }
        private DateTime _Time;
        public static FieldInfo time = new FieldInfo("mdc_Bom_Sefi_2", "Time");

        [Column]
        [DefaultInt(0)]
        public int Status { get { return _Status; } set { _Status = value; EntityState.FieldChange("Status"); } }
        private int _Status;
        public static FieldInfo status = new FieldInfo("mdc_Bom_Sefi_2", "Status");
    }
}
